package com.gjy.pulsar.resolve.config;

import org.apache.pulsar.client.api.PulsarClient;
import org.apache.pulsar.client.api.PulsarClientException;

/**
 * @author gjy
 * @version 1.0
 * @since 2025-10-13 15:39:54
 */
public class PulsarClientConfig {


    /**
     * 生产环境请改为真实的 serviceUrl
     */
    private static final String SERVICE_URL = "pulsar://localhost:6650";

    public static PulsarClient newClient() throws PulsarClientException {
        return PulsarClient.builder()
                .serviceUrl(SERVICE_URL)
                // 开启连接自动恢复
                .enableTcpNoDelay(true)
                .build();
    }

}
